<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$menu_name='welcome';
$page_name="系统首页";
error_reporting(0); //抑制所有错误信息
function show($varName)
{
	switch($result = get_cfg_var($varName))
	{
		case 0:
			return '<font color="red">不支持</font>';
		break;
		case 1:
			return '<font color="green">支持</font>';
		break;
		default:
			return $result;
		break;
	}
}

// 检测函数支持

function isfun($funName = '')
{

    if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误';

	return (false !== function_exists($funName)) ? '<font color="green">支持</font>' : '<font color="red">不支持</font>';
}
?>

<?php require_once 'public/header.php';?>
<?php require_once 'public/sidebar.php';?>

<!--main-container-part-->
<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a class="current" title="系统首页" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> </div>
  </div>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span6">
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-file"></i> </span>
            <h5>系统版本</h5>
          </div>
          <div class="widget-content nopadding">
            <ul class="recent-posts">
              <li>
                欢迎使用<?php echo $this->config->item('system_name');?>，您当前的使用版本为：<?php echo $this->config->item('system_version');?>。 
              </li>
            </ul>
          </div>
        </div>
        
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-file"></i> </span>
            <h5>商业授权</h5>
          </div>
          <div class="widget-content nopadding">
            <ul class="recent-posts">
              <li>
                本系统授权给使用,并保留最终解释权. 
              </li>
            </ul>
          </div>
        </div>
        
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-sitemap"></i> </span>
            <h5>服务器信息</h5>
          </div>
          <div class="widget-content nopadding">
            <ul class="activity-list">
              <li><a>服务器操作系统：<?php $os = explode(" ", php_uname()); echo $os[0];?> &nbsp;内核版本：<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?></a></li>
              <li><a>服务器地址：<?php echo $_SERVER['SERVER_NAME'];?>(IP:<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>) 端口:<?php echo $_SERVER['SERVER_PORT'];?></a></li>
              <li><a>PHP版本（php_version）：<?php echo PHP_VERSION;?></a></li>
              <li><a>脚本超时时间：<?php echo show("max_execution_time");?> 秒</a></li>
              <li><a>服务器解译引擎：<?php echo $_SERVER['SERVER_SOFTWARE'];?></a></li>
              <li><a>站点物理路径：<?php echo $_SERVER['DOCUMENT_ROOT']?str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']):str_replace('\\','/',dirname(__FILE__));?></a></li>
              <li><a>Cookie 支持：<?php echo isset($_COOKIE)?'<font color="green">支持</font>' : '<font color="red">不支持</font>';?></a></li>
              <li><a>Session支持：<?php echo isfun("session_start");?></a></li>
              <li><a>GD库支持：<?php
				  if(function_exists(gd_info)) {
					  $gd_info = @gd_info();
					  echo $gd_info["GD Version"];
				  }else{echo '<font color="red">不支持</font>';}
			  ?></a></li>
            </ul>
          </div>
        </div>
      </div>
      <div class="span6">
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"><i class="icon-bar-chart"></i></span>
            <h5>信息统计</h5>
          </div>
          <div class="widget-content nopadding">
            <ul class="activity-list">
              <?php foreach ($sidelist as $sidevalue){ ?>
              <li><a> <i class="icon-envelope"></i> <strong><?php echo $sidevalue['sub_name']; ?>数：</strong> <span><?php echo $article_num[$sidevalue['en_name']]; ?></span> </a></li>
              <?php } ?>
              <li><a> <i class="icon-user"></i> <strong>管理员：</strong> <span><?php echo $user_num['num'];?></span> </a></li>
            </ul>
          </div>
        </div>
        
      </div>
    </div>
    
  </div>
</div>

<!--end-main-container-part-->

<?php require_once 'public/footer.php';?>